#ifndef __email_h__ #define __email_h__ #include #include // Declaration and defineition of the Email class // // This class is used to build an e-mail message which can // then be sent to some appropriate mailer class Email { public: // ................................................................... // Constructor which takes the IP address of the recipient as argument Email( int recipientAddress ) { m_recipientInternetAddress = recipientAddress ; } //.................................................................. // A method to set the subject line of the e-mail by a text string // passed as argument void setSubject( std::string subj ) { m_subject = subj ; } //.................................................................. // A method to set the main body of the e-mail by a text string // passed as argument. This is a simplification of course, in reality // a long text message would have to be allowed. void setMessage( std::string mess ) { m_message = mess ; } //.......................................... // A method to print out the contents of the e-mail void read( ) { std::cout << std::endl ; std::cout << "Message Subject: " << m_subject << std::endl ; std::cout << " reads: " << m_message << std::endl ; } private: // The IP address of the intended recipient. For simplicity in this // exercise we represent an IP address as a simple integer int m_recipientInternetAddress ; // The subjec to fthe message std::string m_subject ; // The main body test of the message. Again this is a simplification // for the exercise as this only allows a short message. std::string m_message ; }; #endif